package com.verio.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.verio.entity.Contract;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ContractDao extends BaseMapper<Contract> {
    @Select("select * from contract where landlord_idcard = #{idcard} or tenant_idcard = #{idcard}")
    List<Contract> getByUserId(String idcard);

    @Select("select * from contract where landlord = #{landlord} and tenant = #{tenant}")
    Contract getByLandlordAndTenant(@Param("landlord") String landlord, @Param("tenant")String tenant);
}
